<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <!-- <script src="myRequire.js"></script> -->
    <script src="http://apps.bdimg.com/libs/require.js/2.1.9/require.min.js"></script>
    <!-- <script src="http://apps.bdimg.com/libs/seajs/2.3.0/sea.js"></script> -->
</head>
<body>
    
<script>
define("math", ['require', 'exports', 'module'], function(require, exports, module){

    var max = function () {
        //  将参数修改为数组
        var arr = [].slice.call(arguments);

        var max = arr[0];

        arr.forEach(function(item){
            if(max < item){
                max = item;
            }
        });

        return max;
    };

    console.log('math.js');
    
    exports.max = max;

});

define('test', ['require', 'exports', 'module', 'math'], function(require, exports, module){

    console.log( 'require before' );
    
    var _Math = require('math');

    console.log( _Math.max(15, 12) );

});

require(['test']);
// seajs.use('test');
</script>

</body>
</html>